package v1

import (
	"gf_blog_admin/internal/model"
	"github.com/gogf/gf/v2/frame/g"
)

type UploadFileReq struct {
	g.Meta `path:"/file/upload" method:"post" tags:"system" sm:"文件上传" can:"system.file.upload"`
	model.UploadFileInput
}

type UploadFileRes struct {
	*model.UploadFileItem
}

type UploadInitMultipartReq struct {
	g.Meta `path:"/file/multipart/init" method:"get" tags:"system" sm:"初始化分片上传" noCan:"true"`
}

type UploadInitMultipartRes struct {
	*model.UploadInitMultipart
}

type UploadPartReq struct {
	g.Meta `path:"/file/multipart/upload" method:"post" tags:"system" sm:"分片上传" noCan:"true"`
	model.UploadPartInput
}

type UploadPartRes struct {
	*model.UploadPartItem
}

type UploadCompleteMultipartReq struct {
	g.Meta `path:"/file/multipart/complete" method:"post" tags:"system" sm:"完成分片上传" noCan:"true"`
	model.UploadMultipartInput
}

type UploadCompleteMultipartRes struct {
	*model.UploadFileItem
}

type UploadAbortMultipartReq struct {
	g.Meta   `path:"/file/multipart/abort" method:"delete" tags:"system" sm:"删除分片上传" noCan:"true"`
	UploadId string `json:"uploadId" v:"required" dc:"上传ID"`
}

type UploadAbortMultipartRes struct {
}

type UploadListPartsReq struct {
	g.Meta `path:"/file/multipart/list" method:"get" tags:"system" sm:"列举已上传分片" noCan:"true"`
	model.UploadListPartInput
}

type UploadListPartsRes struct {
	*model.UploadListPartOutput
}

type UploadThirdTokenReq struct {
	g.Meta `path:"/file/upload/token" method:"get" tags:"system" sm:"获取第三方上传token" noCan:"true"`
	Drive  string `json:"drive" v:"required" dc:"上传驱动"`
}

type UploadThirdTokenRes struct {
	Token string `json:"token"`
}

type UploadCallbackReq struct {
	g.Meta `path:"/file/upload/callback" method:"get,post" tags:"system" sm:"第三方上传回调" noAuth:"true" noCan:"true"`
	model.UploadCallbackInput
}

type UploadCallbackRes struct{}
